<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<title>ECSHOP 管理中心 - 商品状态 </title>
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/smfs/Public/admin/css/general.css" rel="stylesheet" type="text/css" />
<link href="/smfs/Public/admin/css/main.css" rel="stylesheet" type="text/css" />

<link href="/smfs/Public/css/layui.css" rel="stylesheet" type="text/css" media="all"/>
<script type="text/javascript" src="/smfs/Public/layui.js"></script>

</head>
<body>

<div class="tab-div">

    <div id="tabbar-div">
      <p><span class="tab-back">状态信息</span></p>
    </div>
    <!-- tab body -->
    <div id="tabbody-div">
      <form class="layui-form" method="post">
        <!-- 状态信息 -->
        <table width="90%" id="mix-table" align="center">
          <tr id="alone_sale_1">
            <td class="label" style="vertical-align: inherit;padding: 5px 5px 15px;">上架：</td>
            <td id="alone_sale_3">
            <?php if ($goods_start['is_on_sale'] == 1) { ?>
                <input type="radio" name="is_on_sale" value="1" title="销售" checked="">
                <input type="radio" name="is_on_sale" value="0" title="非销售">
            <?php }else { ?>
                <input type="radio" name="is_on_sale" value="1" title="销售">
                <input type="radio" name="is_on_sale" value="0" title="非销售" checked="">
            <?php } ?>
                <span style="position: absolute;top: 47px;color: red;border: 1px solid #e6d5d5;padding: 0px 2px;">销售状态</span>
                <span class="notice-span" style="display:block;margin-bottom: 10px;"></span>
            </td>
          </tr>
          <tr id="alone_sale_1">
            <td class="label" style="vertical-align: inherit;padding: 5px 5px 15px;">新品：</td>
            <td id="alone_sale_3">
            <?php if ($goods_start['is_new'] == 1) { ?>
                <input type="radio" name="is_new" value="1" title="新品" checked="">
                <input type="radio" name="is_new" value="0" title="非新品">
            <?php }else { ?>
                <input type="radio" name="is_new" value="1" title="新品">
                <input type="radio" name="is_new" value="0" title="非新品" checked="">
            <?php } ?>
                <span style="position: absolute;top: 91px;color: red;border: 1px solid #e6d5d5;padding: 0px 2px;">新品状态</span>
                <span class="notice-span" style="display:block;margin-bottom: 10px;"></span>
            </td>
          </tr>
          <tr id="alone_sale_1">
            <td class="label" style="vertical-align: inherit;padding: 5px 5px 15px;">热销：</td>
            <td id="alone_sale_3">
            <?php if ($goods_start['is_hot'] == 1) { ?>
                <input type="radio" name="is_hot" value="1" title="热销" checked="">
                <input type="radio" name="is_hot" value="0" title="非热销">
            <?php }else { ?>
                <input type="radio" name="is_hot" value="1" title="热销">
                <input type="radio" name="is_hot" value="0" title="非热销" checked="">
            <?php } ?>
                <span style="position: absolute;top: 135px;color: red;border: 1px solid #e6d5d5;padding: 0px 2px;">热销状态</span>
                <span class="notice-span" style="display:block;margin-bottom: 10px;"></span>
            </td>
          </tr>
        </table>
        <div class="button-div">
          <input type="hidden" name="goods_id" value="<?php echo ($goods_start["goods_id"]); ?>">
          <button lay-submit lay-filter="*" > 确定 </button>
          <input type="reset" value=" 重置 " >
        </div>
      </form>
    </div>
</div>
<!-- end goods form -->

<script type="text/javascript">
    layui.use(['form','layedit'], function(){
      $ = layui.jquery;
      var layer = layui.layer
      ,layedit = layui.layedit
      ,form = layui.form();
      //layer.msg('Hello World');


    form.on('submit(*)', function(data){
        $.ajax({
            url: "<?php echo U('admin/goods/goodstart');?>",//请求地址
            type: "post",//请求方式
            dataType: "json",//返回数据类型
            data: data.field,//发送的参数
            })
            .done(function(response) {
                  if(response.error==0){
                     layer.msg(response.info ,{icon:5});

                  }else{
                     layer.msg(response.info ,{icon:6});
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                    parent.location.reload();
                  }
              })
            .fail(function() {
                alert("ajxs交互失败");
            })  

          return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });  
    });
</script>
</body>
</html>